import React, { memo, useEffect, useState } from "react";
import { WebView } from '@tarojs/components'
import { useRouter } from '@tarojs/taro';
import { queryNewDetail } from "@/services";
import './index.scss'

function HotNews() {

  const router = useRouter()
  const [newDeatil, setNewDetail] = useState({})
  useEffect(() => {
    let newsId = router.params?.newsId
    if (newsId) {
      queryNewDetail({ newsId }).then(res => {
        setNewDetail(res.data)
      })
    }
  }, [router.params])
  return (

    <WebView src={newDeatil?.content} />


  )
}

export default memo(HotNews)
